define([
        'underscore',
        'app/service/GeneralServices',
        'app/utils/WebUtils',
        'app/utils/CommonUtils'
        ], function (
		_,
		GeneralServices,
		WebUtils
    ) {


	var s = {};
	
	s.showStagingPanel = function(useruuid, roomuuid, needSave){
		if(typeof(needSave) == "undefined" || needSave==false){
			$(".wjt_staging_upload_operation").show();	
			
			$(".room-staging-ratio-options-group").find("label").removeClass("am-active");
			$(".room-staging-ratio-options-group").find("label:last").addClass("am-active");
			$(".room-staging-ratio-options-group").find("label").find("input").removeAttr("checked");
			$(".room-staging-ratio-options-group").find("label:last").find("input").prop("checked","checked");

		}else{
			var p = {
				useruuid:useruuid,
				roomuuid:roomuuid,
				staging:"1"
			};
			GeneralServices.room_staging(p,function(resp){
				if(resp.status != "200"){
					WebUtils.alert("更新操作没有成功，请重试");
					return;
				}
				$(".wjt_staging_upload_operation").show();
			});
		}
		
	};
	
	s.hideStagingPanel = function(useruuid, roomuuid,needSave){
		if(typeof(needSave) == "undefined" || needSave==false){
			$(".wjt_staging_upload_operation").hide();
			
			$(".room-staging-ratio-options-group").find("label").removeClass("am-active");
			$(".room-staging-ratio-options-group").find("label:first").addClass("am-active");
			$(".room-staging-ratio-options-group").find("label").find("input").removeAttr("checked");
			$(".room-staging-ratio-options-group").find("label:first").find("input").prop("checked","checked");
			
		}else{
			var p = {
				useruuid:useruuid,
				roomuuid:roomuuid,
				staging:"0"
			};
			GeneralServices.room_staging(p,function(resp){
				if(resp.status != "200"){
					WebUtils.alert("更新操作没有成功，请重试");
					return;
				}
				$(".wjt_staging_upload_operation").hide();
			});	
		}
		
	};
	
	return s;

});
